import Vue from 'vue'
import axios from 'axios'
// import VueAxios from 'vue-axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue'
import router from './router'
import store from './store'

// 全局方法的引入和挂载
import {
  gGet,
  gPost,
  gDelete,
  gPut
} from './utils/request';
import {
  handleMenuTree,
  handleRouterTree
} from './utils/typeTransitions'

Vue.prototype.gGet = gGet;
Vue.prototype.gPost = gPost;
Vue.prototype.gDelete = gDelete;
Vue.prototype.gPut = gPut;

Vue.prototype.handleMenuTree = handleMenuTree;
Vue.prototype.handleRouterTree = handleRouterTree;

Vue.use(ElementUI);


Vue.filter('dateFilter', (value) => {
  if (!value) return ''
  var date = new Date(parseInt(value))
  return date.toLocaleString()
})

//axios全局配置

// axios.defaults.baseURL = "http://122.152.251.148:3000"
// axios.defaults.baseURL = "http://81.68.177.23:3000"
axios.defaults.baseURL = "http://127.0.0.1:3000"
Vue.prototype.$axios = axios;
Vue.config.productionTip = false

// Vue.use(VueAxios, axios)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')